package hibernate.clientAccount;

import java.util.Date;
import hibernate.p.Address;
import hibernate.p.DocType;
import hibernate.p.TelNumber;

public class ClientBasicInfo {
	
	private SingleClient client;
	private String firstName=new String();
	private String lastName=new String();
	private String middleName=new String();
	private String docNumber=new String();
	private int age=0;
	private Date birthday=new Date();
	private boolean sex=false;
	private Address address=new Address(null,null,null,null);
	private DocType documentType=DocType.get("ID_CARD");
	private TelNumber telNumber1=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber2=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber3=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber4=new TelNumber(-1,-1,-1,-1);
	private Long id;
	private Date register;
	
	public void setRegisterDate(Date registerer){
		this.register=registerer;
	}
	
	public Date getRegisterDate(){
		return this.register;
	}
	
	public Long getId(){return id;}
	
	public void setId(Long id){this.id=id;}
	
	public void setClient(SingleClient client){this.client=client;}
	
	public SingleClient getClient(){return client;}
	
	public void setFirstName(String firstname){
		firstName=firstname;
	}
	
	public String getFirstName(){
		return firstName;
	}
	
	public void setLastName(String lastname){
		lastName=lastname;
	}
	
	public String getLastName(){
		return lastName;
	}
	
	public void setMiddleName(String middlename){
		middleName=middlename;
	}
	
	public String getMiddleName(){
		return middleName;
	}
	
	public void setDocNumber(String docNum){
		docNumber=docNum;
	}
	
	public String getDocNumber(){
		return docNumber;
	}
	
	public void setAge(int age){
		this.age=age;
	}
	
	public int getAge(){
		return age;
	}
	
	public void setBirthday(Date birthday){
		this.birthday=birthday;
	}
	
	public Date getBirthday(){
		return birthday;
	}
	
	public void setSex(boolean sex){
		this.sex=sex;
	}
	
	public boolean getSex(){
		return sex;
	}
	
	public void setAddress(String address){
		this.address=Address.parseAddress(address);
	}
	
	public String getAddress(){
		return address.toString();
	}
	
	public void setTelNumber1(String telNum){
		telNumber1=TelNumber.parseString(telNum);
	}
	
	public String getTelNumber1(){
		return telNumber1.toString();
	}
	
	public void setTelNumber2(String telNum){
		telNumber2=TelNumber.parseString(telNum);
	}
	
	public String getTelNumber2(){
		return telNumber2.toString();
	}
	
	public void setTelNumber3(String telNum){
		telNumber3=TelNumber.parseString(telNum);
	}
	
	public String getTelNumber3(){
		return telNumber3.toString();
	}
	
	public void setTelNumber4(String telNum){
		telNumber4=TelNumber.parseString(telNum);
	}
	
	public String getTelNumber4(){
		return telNumber4.toString();
	}
	
	public void setDocType(String docType){
		documentType=DocType.get(docType);
	}
	
	public String getDocType(){
		return documentType.toString();
	}
	
	public boolean equals(Object clInfo){
		if(!(clInfo instanceof AbstractClient))
			return false;
		else return this.id.equals(((ClientBasicInfo)clInfo).id);
	}
	
	public String toString(){
		return this.firstName+" "+this.lastName;
	}
	
}
